﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SDT.Lib.Paging;
using SDT.Model;
using SDT.Systems;
using System.Web.Mvc;
using System.Web.UI.WebControls;

namespace SDT.Admin.ViewModels
{
    public class ProductCategoryViewModels
    {
        public IPagedList<ProductCategory> Categories;
        public int? CurrentPubStatus;
        public string Keyword;
        public List<SelectListItem> ListStatusPub
        {
            get
            {
                List<SelectListItem> list = new CommonType().ToList();
                if (this.CurrentPubStatus.HasValue)
                    list.SingleOrDefault(i => int.Parse(i.Value) == this.CurrentPubStatus.Value).Selected = true;

                return list;
            }
        }
        public List<SelectListItem> ListProductType = new List<SelectListItem>();

        public string ImageRootUrl;
    }

    public class ProductCategoryInputModels
    {
        public ProductCategoryInputModels()
        {
        }
        [NonSerialized]
        public TreeNodeCollection ListCategories;
        [NonSerialized]
        public List<SelectListItem> ListProductType = new List<SelectListItem>();
        public ProductCategory Category
        {
            get;
            set;
        }
    }

    public class ProductCategoryEditModels
    {
        public ProductCategoryEditModels()
        {
        }

        public ProductCategory Category
        {
            get;
            set;
        }
        [NonSerialized]
        public TreeNodeCollection ListParentCategories;
        [NonSerialized]
        public List<SelectListItem> ListProductType = new List<SelectListItem>();
        [NonSerialized]
        public string ParentCatName = string.Empty;
    }
}
